import Vue from 'vue'
import App from './App.vue'

import VueRouter from 'vue-router';
import {routes} from './routes';
import iView from 'iview';
import 'iview/dist/styles/iview.css';    // 使用 CSS
import axios from 'axios'
import VueAxios from 'vue-axios'
import {store} from './index.js'
import VueQuillEditor from 'vue-quill-editor'
import VueBase64FileUpload from 'vue-base64-file-upload';

axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';

Vue.use(VueAxios, axios)
Vue.use(VueRouter);
Vue.use(iView);
Vue.use(VueQuillEditor)
Vue.use(VueBase64FileUpload)

const router = new VueRouter({
  routes: routes,
  model:'history'
})

router.beforeEach((to, from, next) => {
  iView.LoadingBar.start();
  next();
});

router.afterEach(route => {
  iView.LoadingBar.finish();
});

new Vue({
  el: '#app',
  store,
  router,
  render: h => h(App)
})
